# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ausweisapp2
pkgver=1.20.1
pkgrel=0
pkgdesc="Official authentication app for German ID card and residence permit"
url="https://www.ausweisapp.bund.de/"
arch="all !armhf" # missing qt5-qtquickcontrols2
license="EUPL-1.2"
depends="pcsc-lite pcsc-cyberjack ccid acsccid"
makedepends="cmake pkgconf pcsc-lite-dev http-parser-dev openssl-dev
			qt5-qtbase-dev qt5-qtsvg-dev qt5-qtwebsockets-dev qt5-qttools-dev
			qt5-qtdeclarative-dev qt5-qtquickcontrols2-dev"
source="https://github.com/Governikus/AusweisApp2/releases/download/$pkgver/AusweisApp2-$pkgver.tar.gz"
options="!check" # no upstream tests in release build
builddir="$srcdir/AusweisApp2-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="97c864ea3d1dcf04c69dbe5b7f9235571d35ad0ce70702eeed5d2b3aaf0f8c0cb4169919c2475d9eb189d03326351d44f73c145934c046332bd63e37814bcfa4  AusweisApp2-1.20.1.tar.gz"
